Automated oxygen titration